<template>
    <div>
        <Card class="clearfix" style="padding-bottom: 16px">
            <p slot="title">
                车辆信息
            </p>
            <Form label-position="left" :label-width="72">
                <Row :gutter="15">
                    <i-col span="2">
                        <Button  @click="addData"  icon="ios-checkmark" style="width:80px;" type="primary">新增</Button>
                    </i-col>
                </Row>
            </Form>
            <br>
            <div>
                <list-table refs="table1" v-model="tableData"  :table-data="tableData"></list-table>
            </div>
            <Page ref="pages" :total="itemTotal" show-total style="float: right; margin-top: 20px" @on-change="getList"></Page>
        </Card>
    </div>
</template>

<script>
    import listTable from './components/listTable.vue'
    import ajax from '../../../libs/axios.js'
    export default {
        name: 'vehicleinfo',
        components: {
            listTable
        },
        data () {
            return {
                tableData:[],  // 表格数据集合
                itemTotal: 1,  // 条数
            }
        },
        methods: {
            init () {
                // this.$store.commit('setActiveName', 'orderv2index');
                this.getList()
            },
            // 车辆信息新增按钮
            addData () {
                this.kezu_testModelShow = true;
                let argu = {
                    id: 'add'
                }
                this.$router.push({
                    name: 'addvehicle',
                    params: argu
                })
            },
            getList () {
                // table Json模拟数据
                let data=[
                    {
                    "id":"0",
                    "vehicle_brand":"一汽大众",
                    "vehicle_type":"速腾 2018款 180TSI DSG臻享版国Ⅴ",
                    "vehicle_price":"LFV1A21K9J4136952",
                    "vehicle_unit_price":"153,800.00",
                    "vehicle_down_payment":"1,000.00",
                    "vehicle_balance_payment":"152,800.00"
                    }
                ]

                this.tableData=data;

            },
        },
        mounted () {
            this.init()
        },
        activated() {
            // this.init()
        },
    }
</script>


<style lang="less">
    @import "../../../styles/common.less";
    @import "../../../styles/table.less";
</style>